﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/RopaOnline.Master" AutoEventWireup="true"
    CodeBehind="TypeAddressSearch.aspx.cs" Inherits="Upsam.RopaOnline.Web.TypeAddressSearch" %>

<asp:Content ID="cntHead" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="cntContext" ContentPlaceHolderID="cphContext" runat="server">
    <div>
        <fieldset style="width: 98%; float: left; margin-top: 10px;">
            <legend>Búsqueda Tipo Dirección</legend>
            <div style="width: 98%; float: left; margin-top: 10px;">
                <div style="width: 48%; float: left; padding-left: 10px;">
                    <asp:Label ID="lblTypeAddressName" runat="server" Text="Tipo Producto" AssociatedControlID="txtTypeAddressName"></asp:Label>
                </div>
                <div style="width: 48%; float: left; padding-left: 10px;">
                    <asp:TextBox ID="txtTypeAddressName" runat="server" Width="98%"></asp:TextBox>
                </div>
            </div>
            <div style="width: 98%; float: left; margin-top: 10px; text-align: center; margin-bottom: 10px;">
                <asp:Button ID="btnSearch" runat="server" Text="Buscar" OnClick="btnSearch_Click" />&nbsp;&nbsp;&nbsp;&nbsp;
                <asp:Button ID="btnAdd" runat="server" Text="Agregar" OnClick="btnAdd_Click" />
            </div>
        </fieldset>
        <div style="width: 98%; float: left; height: auto; margin-top: 10px;">
            <div style="width: 98%; float: left; margin-bottom: 10px;">
                Resultado</div>
            <asp:GridView ID="grvTypeAddress" runat="server" BackColor="White" 
                BorderColor="#E7E7FF" BorderStyle="None" BorderWidth="1px" CellPadding="3" 
                DataSourceID="ldsTypeAddress" GridLines="Horizontal" AllowPaging="True" 
                AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="IdTipoDireccion">
                <RowStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" />
                <Columns>
                <asp:ButtonField ButtonType="Link" CommandName="EditItem" CausesValidation="false"
						Text="Editar" />
                    <asp:CommandField ShowDeleteButton="True" />
                    <asp:BoundField DataField="IdTipoDireccion" HeaderText="IdTipoDireccion" 
                        InsertVisible="False" ReadOnly="True" SortExpression="IdTipoDireccion" />
                    <asp:BoundField DataField="TipoDireccion1" HeaderText="TipoDireccion1" 
                        SortExpression="TipoDireccion1" />
                </Columns>
                <FooterStyle BackColor="#B5C7DE" ForeColor="#4A3C8C" />
                <PagerStyle BackColor="#E7E7FF" ForeColor="#4A3C8C" HorizontalAlign="Right" />
                <SelectedRowStyle BackColor="#738A9C" Font-Bold="True" ForeColor="#F7F7F7" />
                <HeaderStyle BackColor="#4A3C8C" Font-Bold="True" ForeColor="#F7F7F7" />
                <AlternatingRowStyle BackColor="#F7F7F7" />
            </asp:GridView>
            <asp:LinqDataSource ID="ldsTypeAddress" runat="server" 
                ContextTypeName="Upsam.RopaOnline.Modelo.Data.RopaOnLineDataContext" 
                EnableDelete="True" OrderBy="TipoDireccion1" TableName="TipoDireccions" 
                Where="TipoDireccion1.Contain(@TipoDireccion1) ">
                <WhereParameters>
                    <asp:ControlParameter ControlID="txtTypeAddressName" Name="TipoDireccion1" 
                        PropertyName="Text" Type="String" ConvertEmptyStringToNull="false" />
                </WhereParameters>
            </asp:LinqDataSource>
        </div>
    </div>
</asp:Content>
